#include <iostream>
#include <string>
#include <stdio.h>
#include <libgen.h>
#include <string.h>

int main(int argc, char **argv)
{
    std::string str("--id=1231231");
    for (const auto& ch : str) {
        printf("%c\n", ch);

    }
    auto pos = str.find('=');
    printf("%s pos:%lu size:%lu len:%lu cap:%lu\n", str.c_str(), pos, str.size(), strlen(str.c_str()), str.capacity());
    printf("basename:%s  dirname:%s\n", basename(argv[0]), dirname(argv[0]));

    str.resize(25);
    memcpy(&str[13], "hello world", 11);
    printf("%s pos:%lu size:%lu len:%lu cap:%lu\n", str.c_str(), pos, str.size(), strlen(str.c_str()), str.capacity());
    printf("string max size:%lu\n", str.max_size());
    return 0;
}
